// 使用接口约束TS对象
{
  interface UserInterface {
    name: string,
    age: number,
    info?(): string,
    [key: string]: any
  }
  // 通过接口约束对象
  let user: UserInterface = {
    name: ' zrf',
    age: 18,
    info() {
      return 'string'
    },
    dwa: 1,
  }
}